package com.beerandjesus.sportofkings.handicapper.model;

import java.util.List;

/**
 * Date: Jul 14, 2012
 * Time: 9:23:59 AM
 */
public abstract class HorseAnalysisResultImpl implements HorseAnalysisResult {
    private int postPosition;
    private MixedNumeral morningLine;
    private String name;
    private List<AnalysisProfile> profiles;
    private List<String> fastWorkouts;
    private String speedFigure;
    private ResultType resultType;
    private int parSpeedCount;

    public int getPostPosition() {
        return postPosition;
    }

    public void setPostPosition(int postPosition) {
        this.postPosition = postPosition;
    }

    public MixedNumeral getMorningLine() {
        return morningLine;
    }

    public void setMorningLine(MixedNumeral morningLine) {
        this.morningLine = morningLine;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<AnalysisProfile> getProfiles() {
        return profiles;
    }

    public void setProfiles(List<AnalysisProfile> profiles) {
        this.profiles = profiles;
    }

    public List<String> getFastWorkouts() {
        return fastWorkouts;
    }

    public void setFastWorkouts(List<String> fastWorkouts) {
        this.fastWorkouts = fastWorkouts;
    }

    public String getSpeedFigure() {
        return speedFigure;
    }

    public void setSpeedFigure(String speedFigure) {
        this.speedFigure = speedFigure;
    }

    public ResultType getResultType() {
        return resultType;
    }

    public void setResultType(ResultType resultType) {
        this.resultType = resultType;
    }

    public int getParSpeedCount() {
        return parSpeedCount;
    }

    public void setParSpeedCount(int parSpeedCount) {
        this.parSpeedCount = parSpeedCount;
    }

    protected String concatenateFastWorkouts() {
        StringBuffer works = null;
        List<String> fw = getFastWorkouts();
        if (fw != null && fw.size() > 0) {
            works = new StringBuffer();
            int count = 1;
            for (String work : fw) {
                works.append(work);
                if (count < getFastWorkouts().size()) {
                    works.append(",");
                }
                count++;
            }
        }
        if (works != null) {
            return works.toString();
        } else {
            return "no works";
        }
    }

}
